<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
    <style>
      * {
  margin: 0;
  padding: 0;
  list-style: none; }

body, html {
  width: 100%;
  height: 100%; }

ul {
  width: 20%;
  height: 25px;
  margin: 100px auto;
  font-size: 0; }
  ul > li {
    display: inline-block;
    width: 25%;
    height: 100%;
    font-size: 16px;
    text-align: center;
    cursor: pointer;
    position: relative; }

li::before {
  display: block;
  width: 0%;
  background: firebrick;
  height: 2px;
  content: "";
  position: absolute;
  top: 21px;
  left: 50%;
  transition: all 0.5s; }


ul li:hover::before {
  left: 25%;
  width: 50%; }
    </style>
    </head>
    <body>
        <ul>
            <li>我是一</li>
            <li>我是二</li>
            <li>我是三</li>
            <li>我是四</li>
        </ul>
    </body>
</html>